﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<!--  start related-activities -->
<div id="related-activities">
    <!--  start related-act-top -->
    <div id="related-act-top">
        <img src="<%=Url.Content("~/Content/images/forms/header_related_act.gif")%>" width="271"
            height="43" alt="" />
    </div>
    <!-- end related-act-top -->
    <!--  start related-act-bottom -->
    <div id="related-act-bottom">
        <!--  start related-act-inner -->
        <div id="related-act-inner">
            <div class="left">
                <a href="">
                    <img src="<%=Url.Content("~/Content/images/forms/icon_plus.gif")%>" width="21" height="21"
                        alt="" /></a></div>
            <div class="right">
                <h5>
                    Create new Listing</h5>
                <ul class="greyarrow">
                    <li><a href="<%=Url.Content("~/")%><%=ViewData["now_controller"]%>Step1">Click here
                        to create</a></li>
                </ul>
            </div>
            <div class="clear">
            </div>
            <div class="lines-dotted-short">
            </div>
            <div class="left">
                <a href="">
                    <img src="<%=Url.Content("~/Content/images/forms/icon_edit.gif")%>" width="21" height="21"
                        alt="" /></a></div>
            <div class="right">
                <h5> 
                    Search Listings</h5>
                <ul class="greyarrow">
                    <li><a href="<%=Url.Content("~/")%><%=ViewData["now_controller"]%>Search">Click here
                        to search </a></li>
                </ul>
            </div>
            <div class="clear">
            </div>
            <div class="lines-dotted-short">
            </div>
            <div class="left">
                <a href="">
                    <img src="<%=Url.Content("~/Content/images/forms/icon_edit.gif")%>" width="21" height="21"
                        alt="" /></a></div>
            <div class="right">
                <h5>
                    View Active Listings(<span data-bind="text: countActive"></span>)</h5>
                <ul class="greyarrow">
                    <li><a href="<%=Url.Content("~/")%><%=ViewData["now_controller"]%>Index/1">Click here
                        to view</a></li>
                </ul>
            </div>
            <div class="clear">
            </div>
            <div class="lines-dotted-short">
            </div>
            <div class="left">
                <a href="">
                    <img src="<%=Url.Content("~/Content/images/forms/icon_edit.gif")%>" width="21" height="21"
                        alt="" /></a></div>
            <div class="right">
                <h5>
                    View Draft Listings(<span data-bind="text: countDraft"></span>)</h5>
                <ul class="greyarrow">
                    <li><a href="<%=Url.Content("~/")%><%=ViewData["now_controller"]%>Index/2">Click here
                        to view</a></li>
                </ul>
            </div>
            <div class="clear">
            </div>
            <div class="lines-dotted-short">
            </div>
            <div class="left">
                <a href="">
                    <img src="<%=Url.Content("~/Content/images/forms/icon_edit.gif")%>" width="21" height="21"
                        alt="" /></a></div>
            <div class="right">
                <h5>
                   <a href="<%=Url.Content("~/")%><%=ViewData["now_controller"]%>Index/3"> View Deleted Listings(<span data-bind="text: countDelete"></span>)</a></h5>
                <ul class="greyarrow">
                    <li><a href="<%=Url.Content("~/")%><%=ViewData["now_controller"]%>Index/3">Click here
                        to view</a></li>
                </ul>
            </div>
            <div class="clear">
            </div>
            <div class="lines-dotted-short">
            </div>
        </div>
        <!-- end related-act-inner -->
        <div class="clear">
        </div>
    </div>
    <!-- end related-act-bottom -->
</div>
<!-- end related-activities -->

<script type="text/javascript">
    $(document).ready(function() {
    var controllerMVC = '<%=Html.ViewContext.Controller.ValueProvider.GetValue("controller").RawValue%>';
    $.ajaxSetup({ cache: false });
        System.Data.CoutStatusModel = function() {
            var self = this;
            self.countActive = ko.observable();
            self.countDraft = ko.observable();
            self.countDelete = ko.observable();
            (function() {
                $.getJSON(BASE_URL + "Listings/Ajax/CountItemByStatusByMoudle/" + controllerMVC, function(result) {
                    //fill data
                   self.countActive(result.Data[0].countActive);
                   self.countDraft(result.Data[0].countDraft);
                   self.countDelete(result.Data[0].countDelete);
                    
                });
            })();
          
        }
        //
        var vmCountStatus = new System.Data.CoutStatusModel();

        ko.applyBindings(vmCountStatus, $("#related-activities")[0]);
    });
</script>

